/**
 * @param {number} n
 * @return {boolean}
*/
var isPowerOfTwo = function(n) {
  if(n <= 0) return false;
  if(n == 1) return true;
  while(n > 1) {
    if(n % 2 != 0) return false;
    n /= 2;
  }
  return true;
};
let n = 1;
console.log(isPowerOfTwo(n));
n = 16;
console.log(isPowerOfTwo(n));
n = 3;
console.log(isPowerOfTwo(n));
n = 4;
console.log(isPowerOfTwo(n));
n = 5;
console.log(isPowerOfTwo(n));
